import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import store from './store'
import uView from 'uview-ui'
import platform from './core/platform'
import bootstrap from './core/bootstrap'
import validate from './utils/validate.js'
Vue.config.productionTip = false
App.mpType = 'app'
import {
	navTo,
	showToast,
	showSuccess,
	showError,
	navBack,
	toLogin,
	getShareUrlParams
} from '@/core/app'
// 当前运行的终端
Vue.prototype.$platform = platform

const app = new Vue({
	...App,
	store,
	created: bootstrap
})
//使用uview
// 挂载全局函数
Vue.prototype.$toast = showToast
Vue.prototype.$success = showSuccess
Vue.prototype.$error = showError
Vue.prototype.$navTo = navTo
Vue.prototype.$getShareUrlParams = getShareUrlParams ;
Vue.prototype.$navBack = navBack ;
Vue.prototype.$toLogin = toLogin ;
Vue.prototype.$validate = validate
Vue.prototype.$onLaunched = new Promise(resolve => {
    Vue.prototype.$isResolve = resolve
})
Vue.prototype.$bus = new Vue()
Vue.use(uView)
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app,
		store,
		created: bootstrap
	}
}
// #endif
